package com.shiyi.design.singleton;

/**
 * 使用枚举的方式
 *
 * @Author qiu
 * @Date 2021/1/10 23:09
 */
public enum SingletonDesignModel9 {

    INSTANCE;

    public static void main(String[] args) {
        for (int i = 0; i < 100; i++) {
            new Thread(() -> System.out.println(Thread.currentThread().getName() + "----" + SingletonDesignModel9.INSTANCE.hashCode())).start();
        }
    }
}
